home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / M / May MacUser Program.cpt / miniGenApp Src / FileUtil.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-29  |  1.8 KB  |  66 lines  |  [TEXT/KAHL]

  1. /* *****************************************************************************
  2.     FILE:             FileUtil.c
  3.     
  4.     DESCRIPTION:     File I/O utilities
  5.  
  6.     AUTHOR:            Kurt W.G. Matthies
  7.         
  8.     Copyright © 1990 by Code of the West, Inc. All Rights Reserved.
  9.  
  10.     
  11.     Revision History:
  12.     ==========================================================
  13.     3.3090    -    May 1990 MacUser Release
  14.     ==========================================================
  15.  
  16.    ***************************************************************************** */
  17. #include "AppConstants.h"
  18.  
  19. #include "FileUtilPr.h"
  20.  
  21.  
  22. /* ------------------------  Local Prototypes  --------------------------------- */
  23.  
  24. void            closeFile            ( short, short );
  25.  
  26. /* ------------------------------------------------------------------------------------------
  27.     closeDocFile     -    close the data file associated with a document
  28.     3.30.90kwgm
  29. --------------------------------------------------------------------------------------------*/
  30. short
  31. closeDocFile (theDoc)
  32.     register DocPtr     theDoc;
  33. {    
  34.     if (!theDoc)
  35.         return;
  36.  
  37.     closeFile (theDoc->volRefNum, theDoc->openFileRefNum);
  38.     
  39.     theDoc->openFileRefNum = 0;
  40.     theDoc->volRefNum = 0;
  41.     
  42.     return (true);
  43.  
  44. } /* closeDocFile */
  45.  
  46. /* -------------------------------------------------------------------------------------
  47.     closeFile    -    close a file specified by fileRef
  48.     3.30.90kwgm
  49. ---------------------------------------------------------------------------------------- */
  50. static void
  51. closeFile (volRef, fileRef)
  52.     short        volRef, fileRef;
  53. {
  54.     if (fileRef > 0)
  55.     {
  56.         FSClose (fileRef);
  57.         FlushVol (0L, volRef);
  58.     }
  59.     
  60. } /* closeFile */
  61.  
  62. /* ===========================================  EOF  ========================================
  63.     Copyright © 1990 by Code of the West, Inc. All Rights Reserved.
  64. ============================================================================================ */    
  65.  
  66.